package de.bht.fb6.cg1.exercise1;

import java.awt.Color;

/**
 * Abstact color model Object.
 * 
 * Describes a color space with basic informations and conversation between a
 * RGB/{@link Color} object and the value from the given color space.
 * 
 * The color space values are always int arrays.
 * @author Dominik Eckelmann
 */
public interface ColorModelInterface {

    /**
     * sets the object to a specific {@link Color}.
     * 
     * @param c     rgb color object.
     * @return new model color values
     */
    public int[] setColor(Color c);

    /**
     * sets the object color to a given color.
     * 
     * @param rgb   int array (length 3) with the r, g, b as value
     * @return new model color values
     * @see ColorModelInterface#setColor(java.awt.Color)
     */
    public int[] setColor(int[] rgb);

    /**
     * set the model to a color from the model.
     * @param color     color component array.
     * @return given color as {@link Color} object
     */
    public Color setModelColor(int[] color);

    /**
     * get the current color.
     * 
     * @return current color
     */
    public Color getColor();

    /**
     * get the colorvalues from the current model.
     * 
     * @return array components are the color components.
     */
    public int[] getModelColor();

    /**
     * returns the color models name.
     * 
     * the name MUST always be of the same size as the single color components.
     * 
     * @return Name of the model
     */
    public String getName();

    /**
     * get the number of color components
     * 
     * @return color components count
     */
    public int getComponentCount();

    /**
     * get the color component labels.
     * 
     * for example RGB the array is [r,g,b]
     * 
     * @return Color component labels
     */
    public char[] getColorLabels();

    /**
     * returns the component value ranges.
     * 
     * @return Range object.
     */
    public Range[] getComponentRange();
}
